vfs: fs_context: fix up param length parsing in legacy_parse_param
authorJamie Hill-Daniel <jamie@hill-daniel.co.uk>
Tue, 18 Jan 2022 07:06:04 +0000 (08:06 +0100)
committerSalvatore Bonaccorso <carnil@debian.org>
Sun, 30 Jan 2022 10:14:49 +0000 (10:14 +0000)
commitfaf68ffd2f76a3140ce4f1e4cd5a6fe249d41a30
tree741bcff01c83f17a85b7c758da94a45c7ee6ef29
parentb028eafd071f34b579e0f616a1a205b491c7c9cc
vfs: fs_context: fix up param length parsing in legacy_parse_param

Origin: https://git.kernel.org/linus/722d94847de29310e8aa03fcbdb41fc92c521756
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2022-0185

The "PAGE_SIZE - 2 - size" calculation in legacy_parse_param() is an
unsigned type so a large value of "size" results in a high positive
value instead of a negative value as expected.  Fix this by getting rid
of the subtraction.

Signed-off-by: Jamie Hill-Daniel <jamie@hill-daniel.co.uk>
Signed-off-by: William Liu <willsroot@protonmail.com>
Tested-by: Salvatore Bonaccorso <carnil@debian.org>
Tested-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name vfs-fs_context-fix-up-param-length-parsing-in-legacy.patch
fs/fs_context.c